/*
 * AxisPainter.h
 *
 *  Created on: 27/07/2011
 *      Author: godinho
 */

#ifndef AXISPAINTER_H_
#define AXISPAINTER_H_

#define AXIS_LEFT 1
#define AXIS_RIGHT 2
#define AXIS_TOP 3
#define AXIS_BOTTOM 4

#include <qpainter.h>
#include <qevent.h>
#include <qfontmetrics.h>

class AxisPainter {
public:
	AxisPainter();
	virtual ~AxisPainter();

	virtual void paint(QPainter* painter, QRect bounds, float maxValueX, float maxValueY);
	QPoint getPoint(float x, float y);
    int getPlotAreaHeight() const;
    int getPlotAreaWidth() const;
    float getScaleX() const;
    float getScaleY() const;
    int getX() const;
    int getY() const;

private:
	int round5(int n);
	float offset(int dm, float scala);
private:
	float mScaleX;
	float mScaleY;
	int mX;
	int mY;
	int mPlotAreaWidth;
	int mPlotAreaHeight;
	QBrush mBrush;
	QPen mAuxiliarLinePen;
	QFont mFont;
	QPen mPen;
	QFontMetrics* mFontMetrics;
};

#endif /* AXISPAINTER_H_ */
